package daily.aug0813;

import java.io.File;

public class FileMethod_Judgment {
    public static void main(String[] args) {
        //exists()方法
        File file01 = new File("D:\\Development\\eclipse\\eclipse.exe");
        System.out.println(file01.exists());//true
        File file02 = new File("D:\\Development\\eclipse\\idea.exe");
        System.out.println(file02.exists());//false

        //isDirectory()、isFile()方法
        if(file01.exists()){
            System.out.println(file01.isDirectory());//false
            System.out.println(file01.isFile());//true
        }
        if(file02.exists()){
            System.out.println(file01.isDirectory());//无输出
            System.out.println(file01.isFile());//无输出
        }
    }
}
